home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 25 / AMIGAplus Sonderheft 25 (2000)(Falke)(DE)(Track 1 of 4)[!].iso / PublicDomain / Anwendungen / ITimeCalc / ITimeCalc.c < prev    next >
C/C++ Source or Header  |  1999-04-13  |  3KB  |  77 lines

  1. /*
  2.     ITimeCalc v1.1 © 1999 Fredrik Rambris. Restrictionless.
  3.     Description: Shows you the current Internet-time invented by Swatch.
  4.  
  5.     Use freely to implement this new timemeasuring into your programs.
  6.     No guarantees. Use at own risc.
  7.  
  8.     Updated by Gunther Nikl <gnikl@informatik.uni-rostock.de> 13.04.99
  9.  
  10.  
  11. The following was grabbed from http://www.swatch.com.
  12. ----------------------------------------------------------------------------
  13.  
  14. What is this new Universal Time?
  15.  
  16. Timed by Swatch
  17.  
  18. Internet Time represents a completely new global concept of time. So what
  19. is the deal? Basically, the Swatch Beat, the revolutionary new unit of time
  20. means the following:
  21.  
  22. No Time Zones
  23. No Geographical Borders
  24.  
  25. How long is a Swatch beat? In short we have divided up the virtual and real
  26. day into 1000 "beats". One Swatch beat is the equivalent of 1 minute 26.4
  27. seconds. That means that 12 noon in the old time system is the equivalent
  28. of @500 Swatch beats.
  29.  
  30. Okay, so how can a surfer in New York, or a passenger on a transatlantic
  31. flight know when it is @500 Swatch Beats in Central Europe for example? How
  32. can the New York surfer make a date for a chat with his cyber friend in
  33. Rome? Easy, Internet Time is the same all over the world. (see converter)
  34.  
  35. How is this possible? We are not just creating a new way of measuring time,
  36. we are also creating a new meridian in Biel, Switzerland, home of Swatch.
  37. Biel Mean Time (BMT) will be the universal reference for Internet Time. A
  38. day in Internet Time begins at midnight BMT (@000 Swatch Beats) (Central
  39. European Wintertime).
  40.  
  41. The meridian is marked for all to see on the façade of the Swatch
  42. International Headquarters on Jakob-Staempfli Street, Biel, Switzerland. So
  43. it is the same time all over the world, be it night or day, the era of time
  44. zones has disappeared.
  45.  
  46. The BMT meridian was inaugurated on 23 October 1998 in the presence of
  47. Nicholas Negroponte, founder and director of the Massachusetts Institute of
  48. Technology`s Media Laboratory.
  49.  
  50. */
  51.  
  52. #include <clib/dos_protos.h>
  53. #include <clib/locale_protos.h>
  54.  
  55. LONG GetITime( struct Locale *i_locale );
  56.  
  57. void main(void)
  58. {
  59.     struct Locale *loc = OpenLocale( NULL );
  60.  
  61.     if( loc )
  62.     {
  63.         Printf("The current internet-time is: @ %ld\n",GetITime( loc ) );
  64.         CloseLocale( loc );
  65.     }
  66. }
  67.  
  68. /* This is the function that does it. It returns -1 if you don't give it a Locale*/
  69. LONG GetITime( struct Locale *i_locale )
  70. {
  71.     struct DateStamp ds;
  72.     if( !i_locale ) return( -1L );
  73.     DateStamp(&ds);
  74.  
  75.     return( (((ds.ds_Minute+i_locale->loc_GMTOffset+60+1440)%1440)*1000)/1440 );
  76. }
  77.